import { Component, OnInit } from '@angular/core';
import { Response } from '@angular/http';

import {CatService} from '../../../service/cat.service';


@Component({
  selector: 'app-cat-menu',
  templateUrl: './cat-menu.component.html',
  styleUrls: ['./cat-menu.component.less']
})
export class CatMenuComponent implements OnInit {
  categorys;
  constructor(private catService: CatService) { }

  ngOnInit() {
    this.catService.getCat().subscribe(
      (response: Response) => {
        const data = response.json();
        this.categorys = data;
      }
    );
  }

}
